
public class Tuple<S1, S2> 
{
	private S1 m_item1;
	private S2 m_item2;
	
	public Tuple(S1 item1,S2 item2)
	{
		m_item1 = item1;
		m_item2 = item2;
	}
	
	public S1 getItem1()
	{
		return m_item1;
	}
	
	public S2 getItem2()
	{
		return m_item2;
	}
	
	public boolean equals(Object obj)
	{
		if(obj == null)
			return false;
		
		if (obj == this)
            return true;
		
		if (!(obj instanceof Tuple<?,?>))
			return false;
		
		try
		{
			Tuple<S1,S2> other = (Tuple<S1,S2>)obj;
			return (getItem1().equals(other.getItem1()) && 
					getItem2().equals(other.getItem2()));
		}
		catch(Exception exc)
		{
			return false;
		}
	}
	
	public int hashCode()
	{
		return new String(getItem1().hashCode() + "|" + getItem2().hashCode()).hashCode();
	}
}
